package com.ytc.restcontroller;

import com.ytc.mapper.BookshelfMapper;
import com.ytc.model.Bookshelf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 详细介绍类情况.
 *
 * @ClassName BookshelfServiceImpl
 * @Author zk
 * @Date 2023/1/13
 * @Version 1.0
 */
@RestController
public class BookshelfServiceImpl {

    @Autowired
    private BookshelfMapper bookshelfMapper;

    //张阔：加入书架
    @RequestMapping("addShelf")
    void addShelf(@RequestParam("uId") Integer uId, @RequestParam("blId") Integer blId){
        bookshelfMapper.addShelf(uId,blId);
    }

    //张阔：查询书架是否存在该书籍
    @RequestMapping("queryShelfByUidAndBid")
    public Bookshelf queryShelfByUidAndBid(@RequestParam("uId") Integer uId, @RequestParam("blId") Integer blId){
        return bookshelfMapper.queryShelfByUidAndBid(uId,blId);
    }
}
